﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 徐州工业学校01 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "TActions",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ActionCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ActionName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Position = table.Column<int>(type: "int", nullable: true),
                    Icon = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Method = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CssClassName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TActions", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TAgvInstructs",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RequestUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RequstBody = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RequstType = table.Column<int>(type: "int", nullable: true),
                    Respone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Success = table.Column<bool>(type: "bit", nullable: true),
                    RetryTimes = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TAgvInstructs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TAreas",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsRealArea = table.Column<bool>(type: "bit", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    WhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    TypeId = table.Column<int>(type: "int", nullable: false),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BuiltArea = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ShelfCount = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TAreas", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TAuditRecords",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RecordType = table.Column<int>(type: "int", nullable: false),
                    RecordId = table.Column<int>(type: "int", nullable: false),
                    AuditUserId = table.Column<int>(type: "int", nullable: true),
                    AuditUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    AuditStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditUserRealName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModuleName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TAuditRecords", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TBarCodeRules",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Type = table.Column<int>(type: "int", nullable: false),
                    RuleDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BarCodeRules = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaxNumber = table.Column<int>(type: "int", nullable: true),
                    Sample = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NumberLength = table.Column<int>(type: "int", nullable: true),
                    StartNumber = table.Column<int>(type: "int", nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    IsEnable = table.Column<bool>(type: "bit", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TBarCodeRules", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TCachePorts",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaType = table.Column<int>(type: "int", nullable: false),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    WorkMode = table.Column<int>(type: "int", nullable: true),
                    IsUsed = table.Column<bool>(type: "bit", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TCachePorts", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TCarriers",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddrDetail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact1 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact1Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Fax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TCarriers", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TCells",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CellType = table.Column<int>(type: "int", nullable: false),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    WhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: false),
                    AreaCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoutewayId = table.Column<int>(type: "int", nullable: false),
                    ShelfId = table.Column<int>(type: "int", nullable: false),
                    ShelfCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ShelfName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    LineNo = table.Column<int>(type: "int", nullable: false),
                    LayerNo = table.Column<int>(type: "int", nullable: false),
                    ColumnNo = table.Column<int>(type: "int", nullable: false),
                    DepthIndex = table.Column<int>(type: "int", nullable: false),
                    IsMaxDepth = table.Column<bool>(type: "bit", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BusinessType = table.Column<int>(type: "int", nullable: false),
                    IsLock = table.Column<bool>(type: "bit", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FullStatus = table.Column<int>(type: "int", nullable: false),
                    DistanceValue = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    LogicalPartCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LogicalPartName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HeightType = table.Column<int>(type: "int", nullable: false),
                    ActualLine = table.Column<int>(type: "int", nullable: false),
                    ActualCellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ActualCellName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ActualRowName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TCells", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TCompanies",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddrDetail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Tel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TCompanies", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TCustomers",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddrDetail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ResponsiblePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Tel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MobilePhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Shortname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Postcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MengNiuStatus = table.Column<bool>(type: "bit", nullable: false),
                    MengNiuEmphasis = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TCustomers", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TDepartmentOwners",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DepartmentId = table.Column<int>(type: "int", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TDepartmentOwners", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TDepartments",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DepartmentCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DepartmentName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ParentId = table.Column<int>(type: "int", nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TDepartments", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TDevices",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeviceType = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: true),
                    ExceptionMsg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExceptionDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TDevices", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TDictItems",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TypeId = table.Column<int>(type: "int", nullable: false),
                    ItemName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ItemCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ItemValue = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ParentId = table.Column<int>(type: "int", nullable: true),
                    LevelIndex = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsEnd = table.Column<bool>(type: "bit", nullable: true),
                    TypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDefault = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TDictItems", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TDictTypes",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsTree = table.Column<bool>(type: "bit", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TDictTypes", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TDisasterLevels",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Type = table.Column<int>(type: "int", nullable: true),
                    Season = table.Column<int>(type: "int", nullable: true),
                    Level = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TDisasterLevels", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TDisasterMaterials",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutQuantity = table.Column<int>(type: "int", nullable: true),
                    DisasterLevelId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TDisasterMaterials", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TErrorLogs",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Type = table.Column<int>(type: "int", nullable: true),
                    RequestUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RequestBody = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Response = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ErrorExcetionMsg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Ip = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HostName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TErrorLogs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TInstructs",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    InstructType = table.Column<int>(type: "int", nullable: false),
                    WorkDeviceType = table.Column<int>(type: "int", nullable: true),
                    Action = table.Column<int>(type: "int", nullable: true),
                    Priority = table.Column<int>(type: "int", nullable: false),
                    FromLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExpectedToLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ToLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    FinishedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ScanedBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InstructIndex = table.Column<int>(type: "int", nullable: false),
                    StartTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsSendSuccess = table.Column<bool>(type: "bit", nullable: true),
                    RelatedOrderId = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    DeviceCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromRoutewayId = table.Column<int>(type: "int", nullable: true),
                    BusinessType = table.Column<int>(type: "int", nullable: false),
                    BusinessGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    RefCellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsSuspend = table.Column<bool>(type: "bit", nullable: true),
                    LogicalCellAddr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TInstructs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TInterfaceLogs",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Url = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CallWay = table.Column<int>(type: "int", nullable: true),
                    CallWayStr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InParam = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutParam = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CallMillisecond = table.Column<int>(type: "int", nullable: true),
                    ExecMillisecond = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ExecDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    FinishedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ReExecTimes = table.Column<int>(type: "int", nullable: true),
                    RefTaskId = table.Column<int>(type: "int", nullable: true),
                    RefInstructId = table.Column<int>(type: "int", nullable: true),
                    ErrorMsg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExecBusinessCalss = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LogType = table.Column<int>(type: "int", nullable: true),
                    Direction = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TInterfaceLogs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TInventories",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationId = table.Column<int>(type: "int", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationDepth = table.Column<int>(type: "int", nullable: false),
                    LocationLineNo = table.Column<int>(type: "int", nullable: false),
                    LocationLayerNo = table.Column<int>(type: "int", nullable: false),
                    LocationColumnNo = table.Column<int>(type: "int", nullable: false),
                    LocationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationHeightType = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    IsLock = table.Column<bool>(type: "bit", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Articlebarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: false),
                    AvailableQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    AllocateQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PutawayQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PickedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackQty = table.Column<int>(type: "int", nullable: true),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true),
                    InStockDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmallBatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CustomerId = table.Column<int>(type: "int", nullable: true),
                    CustomerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeId = table.Column<int>(type: "int", nullable: true),
                    MaterialTypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Qadate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ErplocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoutewayId = table.Column<int>(type: "int", nullable: true),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true),
                    DeptCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeptName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DictReceivingId = table.Column<int>(type: "int", nullable: true),
                    DictReceiving = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BusinessType = table.Column<int>(type: "int", nullable: false),
                    LocationDistanceValue = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    LogicalPartCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RealHeightType = table.Column<int>(type: "int", nullable: true),
                    DisOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InStockShortDate = table.Column<int>(type: "int", nullable: true),
                    WoodPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true),
                    MultPalletId = table.Column<int>(type: "int", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    MaterialCategoryId = table.Column<int>(type: "int", nullable: true),
                    MaterialCategoryName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNoExplain = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ParentPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    InventoryAlert = table.Column<int>(type: "int", nullable: false),
                    WhetherQualified = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TInventories", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TInventoryAdjusts",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true),
                    SourceSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationId = table.Column<int>(type: "int", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    Reason = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StocktakeResultId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TInventoryAdjusts", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TInventoryDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InventoryId = table.Column<int>(type: "int", nullable: false),
                    Barcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsOut = table.Column<bool>(type: "bit", nullable: false),
                    SkuNum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    IsSku = table.Column<bool>(type: "bit", nullable: true),
                    BarcodeRange = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TInventoryDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TInventoryLogs",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceType = table.Column<int>(type: "int", nullable: true),
                    SourceSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmallBatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StartQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ChangeQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    EndQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    BaseUnitId = table.Column<int>(type: "int", nullable: true),
                    BaseUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TInventoryLogs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TInventoryPallets",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WhId = table.Column<int>(type: "int", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationId = table.Column<int>(type: "int", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeId = table.Column<int>(type: "int", nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    BaseUnitId = table.Column<int>(type: "int", nullable: true),
                    BaseUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TInventoryPallets", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TLogs",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LogType = table.Column<int>(type: "int", nullable: false),
                    ActionType = table.Column<int>(type: "int", nullable: true),
                    RecordType = table.Column<int>(type: "int", nullable: true),
                    RecordId = table.Column<int>(type: "int", nullable: true),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RealName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModuleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Ipaddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IpAddressName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UserId = table.Column<int>(type: "int", nullable: true),
                    UserRemark = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TLogs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialBarcodes",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    Barcode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialBarcodes", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialCategories",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateUserId = table.Column<int>(type: "int", nullable: true),
                    UpdateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ParentId = table.Column<int>(type: "int", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsLeaf = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialCategories", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialExtData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FieldId = table.Column<int>(type: "int", nullable: false),
                    FieldName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: false),
                    ControlType = table.Column<int>(type: "int", nullable: true),
                    InputWay = table.Column<int>(type: "int", nullable: true),
                    IsTree = table.Column<bool>(type: "bit", nullable: true),
                    BindDictTypeId = table.Column<int>(type: "int", nullable: true),
                    FieldData = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldValues = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialExtData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialExtFields",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TypeId = table.Column<int>(type: "int", nullable: false),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FullTypeIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FullTypeNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsRequired = table.Column<bool>(type: "bit", nullable: true),
                    ControlType = table.Column<int>(type: "int", nullable: true),
                    InputWay = table.Column<int>(type: "int", nullable: true),
                    InputValues = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsTree = table.Column<bool>(type: "bit", nullable: false),
                    BindDictTypeId = table.Column<int>(type: "int", nullable: true),
                    BindDictTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialExtFields", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialGroups",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Describe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialGroups", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialKeys",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Qadate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeptCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeptName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Mblnr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Mjahr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Zeile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    ProOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialKeys", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialPackages",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: false),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BaseUnitId = table.Column<int>(type: "int", nullable: true),
                    BaseUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackageUnitId = table.Column<int>(type: "int", nullable: true),
                    PackageUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubPackageUnitId = table.Column<int>(type: "int", nullable: true),
                    SubPackageUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FactorBu = table.Column<int>(type: "int", nullable: true),
                    ConversionFactor = table.Column<int>(type: "int", nullable: true),
                    Uomqty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PackageLevel = table.Column<int>(type: "int", nullable: true),
                    Length = table.Column<int>(type: "int", nullable: true),
                    Width = table.Column<int>(type: "int", nullable: true),
                    Height = table.Column<int>(type: "int", nullable: true),
                    Weight = table.Column<int>(type: "int", nullable: true),
                    Volumn = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EquipType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EquipTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialPackages", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterials",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModelSpec = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: false),
                    TypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FullTypeIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FullTypeNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GrossWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NetWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    GrossWeightUnitId = table.Column<int>(type: "int", nullable: true),
                    GrossWeightUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NetWeightUnitId = table.Column<int>(type: "int", nullable: true),
                    NetWeightUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Volum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    VolumUnitId = table.Column<int>(type: "int", nullable: true),
                    VolumUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MinSafetyStock = table.Column<int>(type: "int", nullable: true),
                    MaxSafetyStock = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Img = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialCategoryId = table.Column<int>(type: "int", nullable: true),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: true),
                    MaterialGroupId = table.Column<int>(type: "int", nullable: true),
                    IsNeedCharging = table.Column<bool>(type: "bit", nullable: true),
                    ExpirationMonth = table.Column<int>(type: "int", nullable: true),
                    MaterialCategoryName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDismantle = table.Column<bool>(type: "bit", nullable: true),
                    Articlebarcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Shortname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Tonnagefactor = table.Column<decimal>(type: "decimal(18,7)", nullable: false),
                    WarningDays = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterials", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialWikiFiles",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialWikiId = table.Column<int>(type: "int", nullable: false),
                    FileType = table.Column<int>(type: "int", nullable: false),
                    FileUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FileName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialWikiFiles", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialWikis",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: false),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Title = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Describe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialWikis", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMenuActions",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MenuId = table.Column<int>(type: "int", nullable: false),
                    ActionId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMenuActions", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMenus",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MenuName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MenuUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MenuIcon = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true),
                    ParentId = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsMobile = table.Column<bool>(type: "bit", nullable: false),
                    IsHide = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMenus", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMultPallets",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WoodPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Num = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OwnerCode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMultPallets", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TOwners",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddrDetail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ZipCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contacts = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MobilePhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TOwners", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPackageDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackageClass = table.Column<int>(type: "int", nullable: true),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmallBatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConvertFigre = table.Column<int>(type: "int", nullable: true),
                    Barcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PositionX = table.Column<int>(type: "int", nullable: true),
                    PositionY = table.Column<int>(type: "int", nullable: true),
                    PositionZ = table.Column<int>(type: "int", nullable: true),
                    LayerIndex = table.Column<int>(type: "int", nullable: true),
                    ParentId = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PackageCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsStocktake = table.Column<bool>(type: "bit", nullable: true),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: false),
                    SkuNum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    BarcodeRange = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPackageDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPalletMoveRecord",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: false),
                    BillType = table.Column<int>(type: "int", nullable: false),
                    BusinessType = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MoveInstructId = table.Column<int>(type: "int", nullable: false),
                    BackInstructId = table.Column<int>(type: "int", nullable: true),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true),
                    InventoryId = table.Column<int>(type: "int", nullable: false),
                    FromCellId = table.Column<int>(type: "int", nullable: false),
                    FromCellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromCellName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromCellLineNo = table.Column<int>(type: "int", nullable: false),
                    FromCellLayerNo = table.Column<int>(type: "int", nullable: false),
                    FromCellColumnNo = table.Column<int>(type: "int", nullable: false),
                    FromCellDepthIndex = table.Column<int>(type: "int", nullable: false),
                    MoveToCellId = table.Column<int>(type: "int", nullable: false),
                    MoveToCellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MoveToCellName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MoveToCellLineNo = table.Column<int>(type: "int", nullable: false),
                    MoveToCellLayerNo = table.Column<int>(type: "int", nullable: false),
                    MoveToCellColumnNo = table.Column<int>(type: "int", nullable: false),
                    MoveToCellDepthIndex = table.Column<int>(type: "int", nullable: false),
                    BackToCellId = table.Column<int>(type: "int", nullable: true),
                    BackToCellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BackToCellName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BackToCellLineNo = table.Column<int>(type: "int", nullable: true),
                    BackToCellLayerNo = table.Column<int>(type: "int", nullable: true),
                    BackToCellColumnNo = table.Column<int>(type: "int", nullable: true),
                    BackToCellDepthIndex = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    MoveFinishedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    BackFinishedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    FromCellHeightType = table.Column<int>(type: "int", nullable: false),
                    MoveToCellHeightType = table.Column<int>(type: "int", nullable: false),
                    BackToCellHeightType = table.Column<int>(type: "int", nullable: true),
                    RealHeightType = table.Column<int>(type: "int", nullable: true),
                    RefCellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPalletMoveRecord", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPallets",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    Opprint = table.Column<int>(type: "int", nullable: false),
                    PrintTimes = table.Column<int>(type: "int", nullable: false),
                    LocationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ErplocationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Type = table.Column<int>(type: "int", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPallets", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPaths",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Status = table.Column<int>(type: "int", nullable: false),
                    SrcWhId = table.Column<int>(type: "int", nullable: true),
                    DescWhId = table.Column<int>(type: "int", nullable: true),
                    SrcType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DescType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SrcAddr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DescAddr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Docks = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPaths", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPickingOrderDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPickingOrderDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPickingOrders",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationDepth = table.Column<int>(type: "int", nullable: true),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DescAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPickingOrders", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPickingStationData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RelatedOrderId = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: false),
                    PickingOutTaskId = table.Column<int>(type: "int", nullable: true),
                    PickingOutInstructId = table.Column<int>(type: "int", nullable: true),
                    PickingInTaskId = table.Column<int>(type: "int", nullable: true),
                    PickingInInstructId = table.Column<int>(type: "int", nullable: true),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromLocationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ToStationId = table.Column<int>(type: "int", nullable: true),
                    ToStationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ToStationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PickingQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    HasNotice = table.Column<bool>(type: "bit", nullable: false),
                    NoticeDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    InventoryId = table.Column<int>(type: "int", nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true),
                    RefInvIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPickingStationData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPickingStationDataDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PickingStationDataId = table.Column<int>(type: "int", nullable: true),
                    StationId = table.Column<int>(type: "int", nullable: true),
                    StationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Barcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SkuNum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    IsSku = table.Column<bool>(type: "bit", nullable: true),
                    IsSelected = table.Column<bool>(type: "bit", nullable: true),
                    PickedNum = table.Column<int>(type: "int", nullable: true),
                    BarcodeRange = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPickingStationDataDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPlatforms",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    WhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FunctionType = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    AddrFloor = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPlatforms", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPlatformSets",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StrategyIdForIn = table.Column<int>(type: "int", nullable: true),
                    StrategyBusinessNameForIn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StrategyIdForOut = table.Column<int>(type: "int", nullable: true),
                    StrategyBusinessNameForOut = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StrategyIdForStocktake = table.Column<int>(type: "int", nullable: true),
                    StrategyBusinessNameForStocktake = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LightMaterialTypeIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HeavyMaterialTypeIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    RoutewayMaxOutNum = table.Column<int>(type: "int", nullable: true),
                    IsReAllocation = table.Column<int>(type: "int", nullable: true),
                    SkipAudit = table.Column<int>(type: "int", nullable: true),
                    CurrMode = table.Column<int>(type: "int", nullable: true),
                    WithYingXiao = table.Column<bool>(type: "bit", nullable: true),
                    ExecMinuteInterval = table.Column<int>(type: "int", nullable: true),
                    IsGetAll = table.Column<bool>(type: "bit", nullable: true),
                    IsPointSyncDate = table.Column<bool>(type: "bit", nullable: true),
                    PointSyncDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    AllotOutStationMode = table.Column<int>(type: "int", nullable: true),
                    CollectNow = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPlatformSets", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPutawayOrderDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PutawayOrderId = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPutawayOrderDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TPutawayOrders",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    StackingStorageId = table.Column<int>(type: "int", nullable: false),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationDepth = table.Column<int>(type: "int", nullable: true),
                    Fifodate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    Volume = table.Column<int>(type: "int", nullable: true),
                    Weight = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmallBatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true),
                    ParentPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TPutawayOrders", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TReceivingBillDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillId = table.Column<int>(type: "int", nullable: false),
                    BillNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Articlebarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    ReceivedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ConfirmDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PurchaseOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CheckedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NeedCheckQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    IsNeedQc = table.Column<bool>(type: "bit", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    BatchNoExplain = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TReceivingBillDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TReceivingBills",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CustomerId = table.Column<int>(type: "int", nullable: true),
                    CustomerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    BeginDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    RefSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Receiver = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StoLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    TotalCheckQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CheckedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    IsCreatedChecklist = table.Column<bool>(type: "bit", nullable: true),
                    CheckType = table.Column<int>(type: "int", nullable: true),
                    CheckResult = table.Column<int>(type: "int", nullable: true),
                    Ngreason = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DictReceivingId = table.Column<int>(type: "int", nullable: true),
                    DictReceiving = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TReceivingBills", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TReceivingGoodsDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Barcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderDetailId = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsSku = table.Column<bool>(type: "bit", nullable: true),
                    SkuNum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    WoodPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BarcodeRange = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TReceivingGoodsDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TReceivingOrderDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Articlebarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReceivedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    StackedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PackagedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PackQty = table.Column<int>(type: "int", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmallBatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationId = table.Column<int>(type: "int", nullable: true),
                    LocationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Qadate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CustomerId = table.Column<int>(type: "int", nullable: true),
                    CustomerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InStarDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    MaterialImg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LogicalPartCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LogicalPartName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Mblnr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeptCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeptName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SubmitDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true),
                    SubmitUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditUserId = table.Column<int>(type: "int", nullable: true),
                    AuditUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Mjahr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Zeile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    ProOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RefInVoucherId = table.Column<int>(type: "int", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    ReceivingBillDetailId = table.Column<int>(type: "int", nullable: true),
                    ReceivingBillId = table.Column<int>(type: "int", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    BatchNoExplain = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DictReceivingId = table.Column<int>(type: "int", nullable: true),
                    DictReceiving = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TReceivingOrderDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TRoleMenuActions",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoleId = table.Column<int>(type: "int", nullable: false),
                    MenuId = table.Column<int>(type: "int", nullable: false),
                    ActionId = table.Column<int>(type: "int", nullable: true),
                    IsMobile = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TRoleMenuActions", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TRoles",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoleCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TRoles", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TRoleWarehouses",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WarehouseId = table.Column<int>(type: "int", nullable: false),
                    RoleId = table.Column<int>(type: "int", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TRoleWarehouses", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TRouteways",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    WhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TRouteways", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TRows",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RowId = table.Column<int>(type: "int", nullable: false),
                    RowName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    AreaId = table.Column<int>(type: "int", nullable: false),
                    ShelfId = table.Column<int>(type: "int", nullable: false),
                    ActualityDepthIndex = table.Column<int>(type: "int", nullable: false),
                    RoutewayId = table.Column<int>(type: "int", nullable: true),
                    IsEnable = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TRows", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TScannedPackageDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Status = table.Column<int>(type: "int", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    Num = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TScannedPackageDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TScheduledTasks",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Title = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecordType = table.Column<int>(type: "int", nullable: true),
                    RecordId = table.Column<int>(type: "int", nullable: true),
                    RefId = table.Column<int>(type: "int", nullable: true),
                    Data = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    FinishedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Msg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Priority = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TScheduledTasks", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TShelves",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    AreaId = table.Column<int>(type: "int", nullable: false),
                    AreaCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CellCount = table.Column<int>(type: "int", nullable: true),
                    DisabledCellCount = table.Column<int>(type: "int", nullable: true),
                    Depth = table.Column<int>(type: "int", nullable: true),
                    ShelfType = table.Column<int>(type: "int", nullable: true),
                    RoutewayId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TShelves", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TShippingGoodsDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Barcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderDetailId = table.Column<int>(type: "int", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsOut = table.Column<bool>(type: "bit", nullable: false),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TShippingGoodsDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TShippingLockCells",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true),
                    OrderDetailId = table.Column<int>(type: "int", nullable: true),
                    OrdeSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InventoryId = table.Column<int>(type: "int", nullable: true),
                    CellId = table.Column<int>(type: "int", nullable: true),
                    CellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CellName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CellDepthIndex = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: true),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true),
                    OutQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    InventoryQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    LockIndex = table.Column<int>(type: "int", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmallBatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsPicking = table.Column<bool>(type: "bit", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    RoutewayId = table.Column<int>(type: "int", nullable: true),
                    ParentPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TShippingLockCells", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TShippingOrderDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    Proirity = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: false),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmallBatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    StationId = table.Column<int>(type: "int", nullable: true),
                    StationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackQty = table.Column<int>(type: "int", nullable: true),
                    PickedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ShippedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    FinshDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true),
                    SubmitUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubmitDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    AuditUserId = table.Column<int>(type: "int", nullable: true),
                    AuditUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Mblnr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Mjahr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Zeile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    ProOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeptCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeptName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RefOutVoucherId = table.Column<int>(type: "int", nullable: true),
                    RefDispatchOrderId = table.Column<int>(type: "int", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true),
                    IsSuspend = table.Column<bool>(type: "bit", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    IsOutOrderReview = table.Column<bool>(type: "bit", nullable: true),
                    IsOnceOut = table.Column<bool>(type: "bit", nullable: true),
                    OnceOutGroupGuid = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    CustomerId = table.Column<int>(type: "int", nullable: true),
                    CustomerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CarCord = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TShippingOrderDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStackingStorages",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubTrayQty = table.Column<int>(type: "int", nullable: true),
                    PackQty = table.Column<int>(type: "int", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ExpectedLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ActualLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalLength = table.Column<int>(type: "int", nullable: true),
                    TotalWidth = table.Column<int>(type: "int", nullable: true),
                    TotalHeight = table.Column<int>(type: "int", nullable: true),
                    TotalVolume = table.Column<int>(type: "int", nullable: true),
                    TotalWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Fifodate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Articlebarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmallBatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CacheLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LogicalPartCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WoodPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true),
                    ParentPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStackingStorages", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStationData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StationId = table.Column<int>(type: "int", nullable: false),
                    StationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Barcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: false),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: false),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    FinishDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsPickIn = table.Column<bool>(type: "bit", nullable: true),
                    IsStocktake = table.Column<bool>(type: "bit", nullable: true),
                    IsArrived = table.Column<bool>(type: "bit", nullable: true),
                    IsStackFinished = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStationData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStationRouteways",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WhId = table.Column<int>(type: "int", nullable: true),
                    StationId = table.Column<int>(type: "int", nullable: true),
                    RoutewayId = table.Column<int>(type: "int", nullable: true),
                    StationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoutewayCode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStationRouteways", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStations",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeviceCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    WhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Ledid = table.Column<int>(type: "int", nullable: true),
                    StationSort = table.Column<int>(type: "int", nullable: false),
                    StationType = table.Column<int>(type: "int", nullable: false),
                    FunctionType = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    IsLock = table.Column<bool>(type: "bit", nullable: true),
                    AddrFloor = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStations", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStocktakeGoodsDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Barcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RelatedOrderId = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStocktakeGoodsDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStocktakeResultGoodsDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StocktakeResultId = table.Column<int>(type: "int", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Barcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    SkuNum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    IsSku = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStocktakeResultGoodsDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStocktakeResultRecords",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: false),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: false),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillTypeId = table.Column<int>(type: "int", nullable: true),
                    BillTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CellId = table.Column<int>(type: "int", nullable: true),
                    CellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CellDepthIndex = table.Column<int>(type: "int", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ScanBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OriginalQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CountQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsHandle = table.Column<byte>(type: "tinyint", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStocktakeResultRecords", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStocktakingOrderDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: false),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CellId = table.Column<int>(type: "int", nullable: true),
                    CellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CellDepthIndex = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExpectedStationIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeId = table.Column<int>(type: "int", nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Step = table.Column<int>(type: "int", nullable: true),
                    IsNeedMove = table.Column<bool>(type: "bit", nullable: true),
                    InventoryId = table.Column<int>(type: "int", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStocktakingOrderDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStocktakingOrders",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: false),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CompanyId = table.Column<int>(type: "int", nullable: true),
                    CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PlanType = table.Column<int>(type: "int", nullable: false),
                    StocktakeWay = table.Column<int>(type: "int", nullable: false),
                    MaxLocationCount = table.Column<int>(type: "int", nullable: true),
                    Granularity = table.Column<int>(type: "int", nullable: true),
                    CellCount = table.Column<int>(type: "int", nullable: false),
                    FinishedCount = table.Column<int>(type: "int", nullable: false),
                    TouchTimes = table.Column<int>(type: "int", nullable: true),
                    TouchStartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    TouchEndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LoopTimes = table.Column<int>(type: "int", nullable: false),
                    PriorityLevel = table.Column<int>(type: "int", nullable: false),
                    ExecDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SubmitDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true),
                    SubmitUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    AuditUserId = table.Column<int>(type: "int", nullable: true),
                    AuditUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStocktakingOrders", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStocktakingPlans",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BeginDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    PlanType = table.Column<int>(type: "int", nullable: true),
                    Repeat = table.Column<int>(type: "int", nullable: true),
                    Means = table.Column<int>(type: "int", nullable: true),
                    MaxLocationCount = table.Column<int>(type: "int", nullable: true),
                    Granularity = table.Column<int>(type: "int", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodsAbc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodsIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodsNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStocktakingPlans", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStocktakingStrategies",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExecCycle = table.Column<int>(type: "int", nullable: true),
                    FirstExecBeginDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    FirstExecEndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EffectBeginDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EffectEndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    PlanType = table.Column<int>(type: "int", nullable: true),
                    Repeat = table.Column<int>(type: "int", nullable: true),
                    Means = table.Column<int>(type: "int", nullable: true),
                    MaxLocationCount = table.Column<int>(type: "int", nullable: true),
                    Granularity = table.Column<int>(type: "int", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodsAbc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodsIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodsNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStocktakingStrategies", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStrategies",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BusinessClassName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StrategyType = table.Column<int>(type: "int", nullable: false),
                    IsEnable = table.Column<bool>(type: "bit", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    IsUsed = table.Column<bool>(type: "bit", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStrategies", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TSuppliers",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddrDetail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact1 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact1Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TSuppliers", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TTransferBinGoodsDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true),
                    OrderDetailId = table.Column<int>(type: "int", nullable: true),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TTransferBinGoodsDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TTransferBinOrders",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true),
                    CompanyId = table.Column<int>(type: "int", nullable: true),
                    CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Proirity = table.Column<int>(type: "int", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Reason = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true),
                    SubmitUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubmitDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    AuditUserId = table.Column<int>(type: "int", nullable: true),
                    AuditUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TTransferBinOrders", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TUnitConvertFigres",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: false),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BaseUnitId = table.Column<int>(type: "int", nullable: true),
                    BaseUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: false),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Numerator = table.Column<int>(type: "int", nullable: true),
                    Denominator = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TUnitConvertFigres", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TUnstackData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true),
                    OrderDetailId = table.Column<int>(type: "int", nullable: true),
                    StationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UnstackType = table.Column<int>(type: "int", nullable: true),
                    PackageCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    TaskId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TUnstackData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TUserRoles",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserId = table.Column<int>(type: "int", nullable: false),
                    RoleId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TUserRoles", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TUsers",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RealName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Pwd = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HeadShot = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    Gender = table.Column<int>(type: "int", nullable: true),
                    MobilePhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    JobNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Signature = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserSecret = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsModifyPwd = table.Column<bool>(type: "bit", nullable: true),
                    DepartmentId = table.Column<int>(type: "int", nullable: true),
                    IsSeeOnlySelfData = table.Column<bool>(type: "bit", nullable: true),
                    ShiftCode = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true),
                    ClassCode = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TUsers", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TWarehouses",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    Contact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MobilePhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddrDetail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BuiltArea = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AreaCount = table.Column<int>(type: "int", nullable: true),
                    StationCount = table.Column<int>(type: "int", nullable: true),
                    RoutewayCount = table.Column<int>(type: "int", nullable: true),
                    IsMain = table.Column<bool>(type: "bit", nullable: true),
                    MapCode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TWarehouses", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TWaveOrders",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WaveType = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    StartTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TWaveOrders", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TWorkDocuments",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WhId = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderId = table.Column<int>(type: "int", nullable: true),
                    BillTypeId = table.Column<int>(type: "int", nullable: true),
                    BillTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ErpbillTypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PlanQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    AllocateQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PickedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PutawayQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    SortedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PrintTimes = table.Column<int>(type: "int", nullable: true),
                    StartTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    WorkLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TWorkDocuments", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TTransferBinOrderDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromWhId = table.Column<int>(type: "int", nullable: true),
                    FromWhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromWhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromRegionId = table.Column<int>(type: "int", nullable: true),
                    FromRegionName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromRegionCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromLocationId = table.Column<int>(type: "int", nullable: true),
                    FromLocationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ToWhId = table.Column<int>(type: "int", nullable: true),
                    ToWhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ToWhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ToRegionId = table.Column<int>(type: "int", nullable: true),
                    ToRegionName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ToRegionCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ToLocationId = table.Column<int>(type: "int", nullable: true),
                    ToLocationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExpectedStackingQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ActualStackingQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Quantity = table.Column<int>(type: "int", nullable: true),
                    IsFullStackingProirity = table.Column<bool>(type: "bit", nullable: true),
                    ExceptionCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExceptionText = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    FilterType = table.Column<int>(type: "int", nullable: true),
                    ToLogicalPartCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsPriorityFilling = table.Column<int>(type: "int", nullable: true),
                    TTransferBinOrderId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TTransferBinOrderDetails", x => x.Id);
                    table.ForeignKey(
                        name: "FK_TTransferBinOrderDetails_TTransferBinOrders_TTransferBinOrderId",
                        column: x => x.TTransferBinOrderId,
                        principalTable: "TTransferBinOrders",
                        principalColumn: "Id");
                });

            migrationBuilder.CreateIndex(
                name: "IX_TTransferBinOrderDetails_TTransferBinOrderId",
                table: "TTransferBinOrderDetails",
                column: "TTransferBinOrderId");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "TActions");

            migrationBuilder.DropTable(
                name: "TAgvInstructs");

            migrationBuilder.DropTable(
                name: "TAreas");

            migrationBuilder.DropTable(
                name: "TAuditRecords");

            migrationBuilder.DropTable(
                name: "TBarCodeRules");

            migrationBuilder.DropTable(
                name: "TCachePorts");

            migrationBuilder.DropTable(
                name: "TCarriers");

            migrationBuilder.DropTable(
                name: "TCells");

            migrationBuilder.DropTable(
                name: "TCompanies");

            migrationBuilder.DropTable(
                name: "TCustomers");

            migrationBuilder.DropTable(
                name: "TDepartmentOwners");

            migrationBuilder.DropTable(
                name: "TDepartments");

            migrationBuilder.DropTable(
                name: "TDevices");

            migrationBuilder.DropTable(
                name: "TDictItems");

            migrationBuilder.DropTable(
                name: "TDictTypes");

            migrationBuilder.DropTable(
                name: "TDisasterLevels");

            migrationBuilder.DropTable(
                name: "TDisasterMaterials");

            migrationBuilder.DropTable(
                name: "TErrorLogs");

            migrationBuilder.DropTable(
                name: "TInstructs");

            migrationBuilder.DropTable(
                name: "TInterfaceLogs");

            migrationBuilder.DropTable(
                name: "TInventories");

            migrationBuilder.DropTable(
                name: "TInventoryAdjusts");

            migrationBuilder.DropTable(
                name: "TInventoryDetails");

            migrationBuilder.DropTable(
                name: "TInventoryLogs");

            migrationBuilder.DropTable(
                name: "TInventoryPallets");

            migrationBuilder.DropTable(
                name: "TLogs");

            migrationBuilder.DropTable(
                name: "TMaterialBarcodes");

            migrationBuilder.DropTable(
                name: "TMaterialCategories");

            migrationBuilder.DropTable(
                name: "TMaterialExtData");

            migrationBuilder.DropTable(
                name: "TMaterialExtFields");

            migrationBuilder.DropTable(
                name: "TMaterialGroups");

            migrationBuilder.DropTable(
                name: "TMaterialKeys");

            migrationBuilder.DropTable(
                name: "TMaterialPackages");

            migrationBuilder.DropTable(
                name: "TMaterials");

            migrationBuilder.DropTable(
                name: "TMaterialWikiFiles");

            migrationBuilder.DropTable(
                name: "TMaterialWikis");

            migrationBuilder.DropTable(
                name: "TMenuActions");

            migrationBuilder.DropTable(
                name: "TMenus");

            migrationBuilder.DropTable(
                name: "TMultPallets");

            migrationBuilder.DropTable(
                name: "TOwners");

            migrationBuilder.DropTable(
                name: "TPackageDetails");

            migrationBuilder.DropTable(
                name: "TPalletMoveRecord");

            migrationBuilder.DropTable(
                name: "TPallets");

            migrationBuilder.DropTable(
                name: "TPaths");

            migrationBuilder.DropTable(
                name: "TPickingOrderDetails");

            migrationBuilder.DropTable(
                name: "TPickingOrders");

            migrationBuilder.DropTable(
                name: "TPickingStationData");

            migrationBuilder.DropTable(
                name: "TPickingStationDataDetails");

            migrationBuilder.DropTable(
                name: "TPlatforms");

            migrationBuilder.DropTable(
                name: "TPlatformSets");

            migrationBuilder.DropTable(
                name: "TPutawayOrderDetails");

            migrationBuilder.DropTable(
                name: "TPutawayOrders");

            migrationBuilder.DropTable(
                name: "TReceivingBillDetails");

            migrationBuilder.DropTable(
                name: "TReceivingBills");

            migrationBuilder.DropTable(
                name: "TReceivingGoodsDetails");

            migrationBuilder.DropTable(
                name: "TReceivingOrderDetails");

            migrationBuilder.DropTable(
                name: "TRoleMenuActions");

            migrationBuilder.DropTable(
                name: "TRoles");

            migrationBuilder.DropTable(
                name: "TRoleWarehouses");

            migrationBuilder.DropTable(
                name: "TRouteways");

            migrationBuilder.DropTable(
                name: "TRows");

            migrationBuilder.DropTable(
                name: "TScannedPackageDetails");

            migrationBuilder.DropTable(
                name: "TScheduledTasks");

            migrationBuilder.DropTable(
                name: "TShelves");

            migrationBuilder.DropTable(
                name: "TShippingGoodsDetails");

            migrationBuilder.DropTable(
                name: "TShippingLockCells");

            migrationBuilder.DropTable(
                name: "TShippingOrderDetails");

            migrationBuilder.DropTable(
                name: "TStackingStorages");

            migrationBuilder.DropTable(
                name: "TStationData");

            migrationBuilder.DropTable(
                name: "TStationRouteways");

            migrationBuilder.DropTable(
                name: "TStations");

            migrationBuilder.DropTable(
                name: "TStocktakeGoodsDetails");

            migrationBuilder.DropTable(
                name: "TStocktakeResultGoodsDetails");

            migrationBuilder.DropTable(
                name: "TStocktakeResultRecords");

            migrationBuilder.DropTable(
                name: "TStocktakingOrderDetails");

            migrationBuilder.DropTable(
                name: "TStocktakingOrders");

            migrationBuilder.DropTable(
                name: "TStocktakingPlans");

            migrationBuilder.DropTable(
                name: "TStocktakingStrategies");

            migrationBuilder.DropTable(
                name: "TStrategies");

            migrationBuilder.DropTable(
                name: "TSuppliers");

            migrationBuilder.DropTable(
                name: "TTransferBinGoodsDetails");

            migrationBuilder.DropTable(
                name: "TTransferBinOrderDetails");

            migrationBuilder.DropTable(
                name: "TUnitConvertFigres");

            migrationBuilder.DropTable(
                name: "TUnstackData");

            migrationBuilder.DropTable(
                name: "TUserRoles");

            migrationBuilder.DropTable(
                name: "TUsers");

            migrationBuilder.DropTable(
                name: "TWarehouses");

            migrationBuilder.DropTable(
                name: "TWaveOrders");

            migrationBuilder.DropTable(
                name: "TWorkDocuments");

            migrationBuilder.DropTable(
                name: "TTransferBinOrders");
        }
    }
}
